<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>内容分发</title>
    <script src="../react/react.development.js"></script>
    <script src="../react/react-dom.development.js"></script>
    <script src="../react/babel.min.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
  class Comp extends React.Component {
    render () {
      console.log(this.props)
      // react中利用this.props.children来配置内容分发
      return <div>{this.props.children[1]}<h2>cqg</h2>{this.props.children[0]}</div>
    }
  }
  ReactDOM.render(<Comp><h1>哈哈哈</h1><h2>你好</h2></Comp>, document.getElementById('root'))
</script>
</body>
</html>
